get analytics root content published
Retrieve daily post publication counts from TabNews to analyze content trends and publishing patterns.
Instructions
To get how many posts were made (per day) in tabnews
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/status.ts:217-247 (handler)The MCP tool definition including the handler function that executes the tool logic: fetches analytics data from service, formats as JSON text in McpResponse, and handles errors.export const getAnalyticsRootContentPublishedTool = { name: "get analytics root content published", description: "To get how many posts were made (per day) in tabnews", parameters: {}, handler: async (): Promise<McpResponse> => { try { const result = await getAnalyticsRootContentPublished(); const content: McpTextContent = { type: "text", text: `Analytics Root Content Published:\n\n${JSON.stringify( result, null, 2 )}`, }; return { content: [content], }; } catch (error) { if (error instanceof Error) { throw new Error( `Failed to get analytics root content published: ${error.message}` ); } else { throw new Error("Failed to get analytics root content published"); } } }, };
- src/types/index.ts:125-128 (schema)TypeScript interface defining the structure of the analytics root content published data (output schema).export interface AnalyticsRootContentPublished { date: string; conteudos: number; }
- src/index.ts:66-71 (registration)Registration of the tool in the MCP server using server.tool().server.tool( getAnalyticsRootContentPublishedTool.name, getAnalyticsRootContentPublishedTool.description, getAnalyticsRootContentPublishedTool.parameters, getAnalyticsRootContentPublishedTool.handler );
- src/services/api.ts:92-101 (helper)Helper function that performs the actual API fetch to retrieve the analytics root content published data from TabNews.export async function getAnalyticsRootContentPublished(): Promise< AnalyticsRootContentPublished[] > { const response = await fetch( `${TABNEWS_API_URL}/analytics/root-content-published` ); const data = await response.json(); return data as AnalyticsRootContentPublished[]; }